home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / src / turlwin7.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  1.6 KB  |  53 lines

  1. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  2. //
  3. //    Class:        TURLWindow
  4. //    Include File:    turlwind.h
  5. //    Purpose:    Provide a window for a URL view.
  6. //    Remarks/Portability/Dependencies/Restrictions:
  7. //    Revision History:
  8. //        03-04-94    created
  9. #include"turlwind.h"
  10.  
  11. signed short int TURLWindow::Number(signed short int ssi_Win)    {
  12. //    Purpose:    Find a free window number, and mark it as used, or
  13. //            unmark the specified number as not being used.
  14. //    Arguments:    ssi_Win    When ssi_Win is specified as -1, the default
  15. //                value, a free number will be found, otherwise
  16. //                the value of ssi_Win is marked as being free.
  17. //    Return Value:    signed short int    The free window number.
  18. //    Remarks/Portability/Dependencies/Restrictions:
  19. //        Do not be confused by the duplicity of this function.  It's
  20. //        purpose is simple, find a free window number to use, or
  21. //        clear the specified window number as not being used.
  22. //    Revision History:
  23. //        03-04-94    created
  24.  
  25.     if(ssi_Win == -1)    {
  26.         //    Find a free window number.
  27.         signed short int ssi_findFree;
  28.         for(ssi_findFree = 0; ssi_findFree <= 8; ssi_findFree++)
  29.         {
  30.             if(B_freeWin[ssi_findFree] == True)    {
  31.                 break;
  32.             }
  33.         }
  34.  
  35.         //    Return the free number.
  36.         //    Mark it as used.
  37.         if(ssi_findFree <= 8)    {
  38.             B_freeWin[ssi_findFree] = False;
  39.             return(ssi_findFree + 1);
  40.         }
  41.  
  42.         //    No free window numbers.
  43.         return(wnNoNumber);
  44.     }
  45.  
  46.     if(ssi_Win > 0 && ssi_Win <= 9)    {
  47.         //    Mark the window number as now free.
  48.         B_freeWin[ssi_Win - 1] = True;
  49.     }
  50.     //    Return just for the hell of it.
  51.     //    Should consider this a meaningless value.
  52.     return(ssi_Win);
  53. }